#define  _CRT_SECURE_NO_WARNINGS 
#include <iostream>
using namespace std;

class Date
{
public:
    Date(int year = 2000, int month = 1, int day = 1)
        :_year(year)
        , _month(month)
        , _day(day)
    {}
    bool operator<(const Date& d)
    {
        if (_year < d._year)
        {
            return true;
        }
        else if (_year == d._year && _month < d._month)
        {
            return true;
        }
        else if (_year == d._year && _month == d._month && _day < d._day)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    int getmonthday(int year, int month)
    {
        int arr[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
        if (month == 2 && ((_year % 4 == 0 && _year % 100 != 0) || _year % 400 == 0))
        {
            return 29;
        }
        return arr[month];
    }
    Date& operator+=(int day)
    {
        _day += day;
        while (_day > getmonthday(_year, _month))
        {
            _day -= getmonthday(_year, _month);
            _month++;
            if (_month == 13)
            {
                ++_year;
                _month = 1;
            }
        }
        return *this;
    }
    int operator-(const Date& d)
    {
        Date max = *this;
        Date min = d;
        if (*this < d)
        {
            max = d;
            min = *this;
        }
        int n = 0;
        while (min < max)
        {
            min += 1;
            ++n;
        }
        return n + 1;
    }
private:
    int _year;
    int _month;
    int _day;
};


int main()
{
    int date1, date2;
    while (scanf("%d\n%d", &date1, &date2) != EOF)
    {
        Date d1(date1 / 10000, date1 % 10000 / 100, date1 % 100);
        Date d2(date2 / 10000, date2 % 10000 / 100, date2 % 100);
        cout << (d1 - d2) << endl;
    }
}
